﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="spec_prices_edit.aspx.cs" Inherits="Donal.Xms.Web.qianyi.common.spec_prices_edit" ValidateRequest="false" %>

<%@ Import Namespace="Donal.Xms.Common" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>编辑差异价格</title>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <link rel="stylesheet" type="text/css" href="../../scripts/artdialog/ui-dialog.css" />
    <link rel="stylesheet" type="text/css" href="../skin/icon/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../skin/default/style.css" />
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/jquery/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../../scripts/artdialog/dialog-plus-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/common.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/laymain.js"></script>
    <script type="text/javascript">
        $(function () {

            var para1 = 0;
            var para2 = 0;

            //初始化表单验证
            $("#form1").initValidform();

            $("a").each(function () {
                if ($(this).html() == "规格" || $(this).html() == "商品" || $(this).html() == "品类" || $(this).html() == "会员" || $(this).html() == "组别") {

                    if (($(this).html() == "规格" && $(this).attr("class") == "selected")) {
                        para1 = 0;
                    }

                    if (($(this).html() == "商品" && $(this).attr("class") == "selected")) {
                        para1 = 1;
                    }

                    if (($(this).html() == "品类" && $(this).attr("class") == "selected")) {
                        para1 = 2;
                    }

                    if (($(this).html() == "会员" && $(this).attr("class") == "selected")) {
                        para2 = 0;
                    }

                    if (($(this).html() == "组别" && $(this).attr("class") == "selected")) {
                        para2 = 1;
                    }

                    if (($(this).html() == "商品" || $(this).html() == "品类") && $(this).attr("class") == "selected") {
                        $("#dlForm1").hide();
                        $("#dlForm2").show();
                    }
                }
            });

            $("a").click(function () {
                if ($(this).html() == "规格" || $(this).html() == "商品" || $(this).html() == "品类" || $(this).html() == "会员" || $(this).html() == "组别") {

                    if (($(this).html() == "规格" && $(this).attr("class") == "selected")) {
                        para1 = 0;
                    }

                    if (($(this).html() == "商品" && $(this).attr("class") == "selected")) {
                        para1 = 1;
                    }

                    if (($(this).html() == "品类" && $(this).attr("class") == "selected")) {
                        para1 = 2;
                    }

                    if (($(this).html() == "会员" && $(this).attr("class") == "selected")) {
                        para2 = 0;
                    }

                    if (($(this).html() == "组别" && $(this).attr("class") == "selected")) {
                        para2 = 1;
                    }

                    if ($(this).html() == "商品" || $(this).html() == "品类") {
                        $("#txtGoods_or_category_txt").val('');
                        $("[id$='hidgoods_product_category_id']").val(0);
                    } else {
                        $("#txtUser_or_group_txt").val('');
                        $("[id$='hidUser_or_group_id']").val(0);
                    }

                    if (($(this).html() == "商品" || $(this).html() == "品类") && $(this).attr("class") == "selected") {
                        $("#dlForm1").hide();
                        $("#dlForm2").show();
                    }
                    else {
                        $("#dlForm2").hide();
                        $("#dlForm1").show();
                    }
                }
            });

            $(".select_class_goods_category").click(function () {
                showPremiumDialog(0);
            });

            $("#txtUser_or_group_txt").click(function () {
                showPremiumDialog(1);
            });


            function showPremiumDialog(isGoods) {
                var _title = (isGoods == 0 ? "选择溢价主体" : "选择溢价对象");
                var _para = (isGoods == 0 ? para1 : para2);
                var companyDialog = top.dialog({
                    id: 'PremiumDialogId',
                    title: _title,
                    url: 'dialog/dialog_select_premium.aspx?f=' + isGoods + '&p=' + _para,
                    width: 800,
                    height: 600,
                    onclose: function () {
                        var liHtml = this.returnValue; //获取返回值
                        if (liHtml.length > 0) {
                            $("#showAttachList").children("ul").append(liHtml);
                        }
                    }
                }).showModal();
                companyDialog.data = $(".tab-content");
            }

        });
    </script>
</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <!--导航栏-->
        <div class="location">
            <a href="spec_prices_list.aspx" class="back"><i class="iconfont icon-up"></i><span>返回列表页</span></a>
            <a href="../center.aspx"><i class="iconfont icon-home"></i><span>首页</span></a>
            <i class="arrow iconfont icon-arrow-right"></i>
            <span>差异价格管理</span>
            <i class="arrow iconfont icon-arrow-right"></i>
            <span>编辑差异价格</span>
        </div>
        <div class="line10"></div>
        <!--/导航栏-->

        <!--差异价格-->
        <div id="floatHead" class="content-tab-wrap">
            <div class="content-tab">
                <div class="content-tab-ul-wrap">
                    <ul>
                        <li><a class="selected" href="javascript:;">编辑差异价格</a></li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="tab-content">
            <dl>
                <dt>是否开启</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="rblStatus" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="0" Selected="True">启用</asp:ListItem>
                            <asp:ListItem Value="1">停用</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>溢价主体</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="rblIs_goods" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="0" Selected="True">规格</asp:ListItem>
                            <asp:ListItem Value="1">商品</asp:ListItem>
                            <asp:ListItem Value="2">品类</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>商品或类别</dt>
                <dd>
                    <input type="hidden" id="hidgoods_product_category_id" runat="server" value="0" class="select_class_goods_product_category_id" />
                    <asp:TextBox ID="txtGoods_or_category_txt" runat="server" CssClass="input small select_class_goods_category" Width="200" datatype="*" sucmsg=" " ReadOnly="true" />
                    <asp:Label ID="div_goods_product_category_id_tip" runat="server" CssClass="Validform_checktip" />
                </dd>
            </dl>
            <dl>
                <dt>溢价对象</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="rblIs_user" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="0" Selected="True">会员</asp:ListItem>
                            <asp:ListItem Value="1">组别</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                </dd>
            </dl>
            <dl>
                <dt>会员或组别</dt>
                <dd>
                    <input type="hidden" id="hidUser_or_group_id" runat="server" value="0" class="select_class_User_or_group_id" />
                    <asp:TextBox ID="txtUser_or_group_txt" runat="server" CssClass="input small" Width="200" datatype="*" sucmsg=" " ReadOnly="true" />
                    <asp:Label ID="div_User_or_group_id_tip" runat="server" CssClass="Validform_checktip" />
                </dd>
            </dl>
            <dl id="dlForm1">
                <dt>溢价方式</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="rblPrice_type" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="0" Selected="True">固定价</asp:ListItem>
                            <asp:ListItem Value="1">百分比</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                </dd>
            </dl>
            <dl id="dlForm2" style="display: none;">
                <dt>溢价方式</dt>
                <dd>
                    <div class="rule-multi-radio">
                        <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                            <asp:ListItem Value="1" Selected="True">百分比</asp:ListItem>
                        </asp:RadioButtonList>
                    </div>
                    <span class="Validform_checktip">品类只能用百分比！</span>
                </dd>
            </dl>
            <dl>
                <dt>显示价格</dt>
                <dd>
                    <asp:TextBox ID="txtPrice" runat="server" CssClass="input normal" Width="200" datatype="/^(([1-9]{1}\d*)|([0]{1}))(\.(\d){1,2})?$/" sucmsg=" " />
                    <span class="Validform_checktip">百分比请填写1~100之间的数</span>
                </dd>
            </dl>
        </div>
        <!--/差异价格-->

        <!--工具栏-->
        <div class="page-footer">
            <div class="btn-wrap">
                <asp:Button ID="btnSubmit" runat="server" Text="提交保存" CssClass="btn" OnClick="btnSubmit_Click" />
                <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" />
            </div>
        </div>
        <!--/工具栏-->

    </form>
</body>
</html>

